package com.zelix;

import java.util.*;

public final class bn
        implements Comparable {

    private int a;
    private int b;
    private Vector c;
    private Vector d;
    private bn e;
    private ArrayList f;
    private bn g;
    private ArrayList h;
    private ArrayList i;
    private String j;
    private int k;
    private static String z[];

    public bn() {
        k = -1;
    }

    void a(bn bn1) {
        if (i == null)
            i = new ArrayList();
        i.add(bn1);
    }

    void b(bn bn1) {
        if (f == null)
            f = new ArrayList();
        f.add(bn1);
    }

    void c(bn bn1) {
        if (d == null)
            d = new Vector();
        if (!d.contains(bn1))
            d.addElement(bn1);
    }

    void d(bn bn1) {
        if (c == null)
            c = new Vector();
        if (!c.contains(bn1))
            c.addElement(bn1);
    }

    void e(bn bn1) {
        if (h == null)
            h = new ArrayList();
        h.add(bn1);
    }

    public void a() {
        d = null;
        c = null;
        e = null;
        g = null;
        i = null;
    }

    public int compareTo(Object obj) {
        bn bn1 = (bn) obj;
        if (a < bn1.a)
            return -1;
        return a != bn1.a ? 1 : 0;
    }

    void a(HashMap hashmap, Hashtable hashtable, Hashtable hashtable1) {
        if (c != null) {
            int i1;
            int j1;
            i1 = c.size();
            for (j1 = 0; j1 < i1; j1++) {
                bn bn1 = (bn) c.elementAt(j1);
                Hashtable hashtable3 = a(hashmap, hashtable, hashtable1, bn1, false);
                if (hashtable3 != null)
                    bn1.a(hashmap, hashtable3, hashtable1);
            }
        }
        if (e != null) {
            Hashtable hashtable2 = a(hashmap, hashtable, hashtable1, e, false);
            if (hashtable2 != null)
                e.a(hashmap, hashtable2, hashtable1);
        }
        return;
    }

    private Hashtable a(HashMap hashmap, Hashtable hashtable, Hashtable hashtable1, bn bn1, boolean flag) {
        if (hashtable1.containsKey(bn1)) {
            if (hashtable.containsKey(bn1)) {
                if (!hashmap.containsKey(bn1)) {
                    in in1 = new in(bn1, this);
                    hashmap.put(bn1, in1);
                } else {
                    in in2 = (in) hashmap.get(bn1);
                    in2.a(this);
                }
            } else if (!flag)
                bn1.c(this);
            return null;
        }
        hashtable1.put(bn1, bn1);
        if (!flag)
            bn1.c(this);
        Hashtable hashtable2 = (Hashtable) hashtable.clone();
        hashtable2.put(bn1, bn1);
        return hashtable2;
    }

    Enumeration c() {
        if (i != null)
            return Collections.enumeration(i);
        else
            return mx.a();
    }

    public int d() {
        return b;
    }

    public bn e() {
        if (c != null && c.size() == 2)
            return (bn) c.elementAt(1);
        else
            return null;
    }

    List f() {
        return Collections.unmodifiableList(f);
    }

    Vector g() {
        return d;
    }

    public int a(sn sn1, sn asn[], Hashtable hashtable, bn bn1, bn bn2, bn bn3, Vector vector,
                 um um, wu wu1)
            throws tb {
        int i1;
        int j1;
        if (this == bn3)
            return -1;
        if (this == bn1 && ((kd) vector.elementAt(a)).i()) {
            i1 = a + 1;
        } else
            i1 = a;
        for (j1 = b - 1; j1 >= i1; j1--) {
            if (asn[j1].a() && sn1.b(um, asn[j1])) {
                wu1.a(this);
                return j1;
            }
        }
//_L3:
        if (this != bn2) {
            if (c != null) {
                int k1;
                int i2;
                k1 = c.size();
                for (i2 = 0; i2 < k1; i2++) {
                    bn bn4 = (bn) c.elementAt(i2);
                    if (!hashtable.containsKey(bn4)) {
                        hashtable.put(bn4, bn4);
                        int j2 = bn4.a(sn1, asn, hashtable, bn1, bn2, bn3, vector, um, wu1);
                        if (j2 != -1)
                            return j2;
                    }
                }
            }
            if (e != null && !hashtable.containsKey(e)) {
                hashtable.put(e, e);
                int l1 = e.a(sn1, asn, hashtable, bn1, bn2, bn3, vector, um, wu1);
                if (l1 != -1)
                    return l1;
            }
        }
        return -1;
    }

    public String h() {
        return j;
    }

    public bn i() {
        if (c != null && c.size() > 0)
            return (bn) c.elementAt(0);
        else
            return null;
    }

    public Vector j() {
        return c;
    }

    ArrayList k() {
        return h;
    }

    bn l() {
        return e;
    }

    public int m() {
        return a;
    }

    public bn a() {
        return g;
    }

    boolean n() {
        return h != null && h.size() > 0;
    }

    boolean o() {
        return j != null && j.startsWith(z[0]);
    }

    boolean p() {
        return j != null && j.equals(z[1]);
    }

    boolean a(bn bn1) {
        boolean flag = a(bn1, new HashMap());
        return flag;
    }

    private boolean a(bn bn1, HashMap hashmap) {
        boolean flag;
        int i1;
        int j1;
        if (hashmap.put(bn1, bn1) != null)
            return false;
        if (bn1.d == null)
            return false;
        flag = false;
        i1 = bn1.d.size();
        for (j1 = 0; j1 < i1; j1++) {
            bn bn2 = (bn) bn1.d.get(j1);
            if (bn2 == this)
                return true;
            flag = a(bn2, hashmap);
            if (flag)
                break;
        }
        return flag;
    }

    Enumeration q() {
        if (c != null)
            return c.elements();
        else
            return null;
    }

    public int r() {
        return (b - a) + 1;
    }

    void b(int i1) {
        b = i1;
    }

    void a(String s1) {
        j = s1;
    }

    void f(bn bn1) {
        e = bn1;
    }

    void c(int i1) {
        a = i1;
    }

    void g(bn bn1) {
        g = bn1;
    }

    int s() {
        int i1;
        int j1;
        int k1;
        int l1;
        if (k == -1) {
            i1 = r();
            if (d != null && (j1 = d.size()) > 0) {
                k1 = 0x7fffffff;
                for (l1 = 0; l1 < j1; l1++) {
                    bn bn1 = (bn) d.elementAt(l1);
                    int i2 = bn1.s();
                    if (i2 < k1)
                        k1 = i2;
                }
                i1 += k1;
            }
            k = i1;
        }
        return k;
    }

    public boolean h(bn bn1) {
        return c != null && c.size() == 2 && c.elementAt(0) == bn1;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x42;
                    break;
                case 1:
                    key = 65;
                    break;
                case 2:
                    key = 21;
                    break;
                case 3:
                    key = 120;
                    break;
                case 4:
                    key = 2;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        String as[] = new String[2];
        as[0] = z("! a\033j\f.q\035".toCharArray());
        as[1] = z("*$t\034g0".toCharArray());
        z = as;
    }
}